<template>
  <div class="serviceHeader">
    <div class="breadcrumbs">
      <div class="container">
        <a href="/">首页</a> <span class="sep">/</span> <span>申请售后服务</span>
      </div>
    </div>
    <div class="container">
      <div class="content">
        <div class="service-box service-main-box">
          <div class="service-content-box">
            <div class="box-hd">
              <h1 class="title">申请售后服务</h1>
            </div>
            <div class="box-bd">
              <div style="padding: 20px 0">
                <el-steps :active="active" finish-status="success">
                  <el-step title="选择产品和服务"></el-step>
                  <el-step title="填写申请单"></el-step>
                  <el-step title="完成申请"></el-step>
                </el-steps>
              </div>
              <div class="service-step-box">
                <div class="service-section">
                  <div class="section-hd"><h2 class="section-title">选择进行售后的商品</h2></div>
                  <div class="section-bd">
                    <div class="product-detail">
                      <dl class="detail-list">
                        <dt class="name">{{ order_goods.productName }}</dt>
                        <dd class="imei-no">订单号号：{{ orderNo }}</dd>
                      </dl>
                      <router-link
                        replace
                        :to="{
                        path: '/serviceBase/serviceGoods',
                        query: {
                          orderNo: orderNo,
                        }
                      }" class="back">换其他产品 &gt;
                      </router-link>
                      <img
                        :src="order_goods.imgurl"
                        alt="" class="thumb">
                    </div>
                  </div>
                </div>
                <div class="service-section">
                  <div class="section-hd"><h2 class="section-title">为您的产品选择服务类型</h2></div>
                  <div class="section-bd">
                    <ul class="service-label-list service-label-list-large clearfix">
                      <li>
                        <router-link active-class="active"
                                     :to="{
                                        path:'/service/serviceMaintenance',
                                        query:{
                                          good_id,
                                          orderNo,
                                          service_id:4
                                        }
                                     }">维修
                        </router-link>
                      </li>
                      <li>
                        <router-link active-class="active"
                                     :to="{
                                         path: '/service/serviceRefund',
                                         query:{
                                          good_id,
                                          orderNo,
                                        }
                                     }">退款/退货
                        </router-link>
                      </li>
                      <li>
                        <router-link active-class="active"
                                     :to="{
                                        path: '/service/serviceExchange',
                                        query:{
                                          good_id,
                                          orderNo,
                                          service_id:3
                                        }
                                     }">换货
                        </router-link>
                      </li>
                      <li v-show="order_goods.insurance_id">
                        <router-link active-class="active"
                                     :to="{
                                        path: '/service/insuranceAfterSale',
                                        query:{
                                          good_id,
                                          orderNo,
                                          service_id:5
                                        }
                                     }">保险售后
                        </router-link>
                      </li>
                    </ul>
                  </div>
                </div>
                <div class="service-section">
                  <div class="section-hd"><h2 class="section-title">填写申请表</h2></div>
                  <router-view></router-view>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="breadcrumbs">
      <div class="container">
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "ServiceHeader",
  props: ['orderNo', 'good_id'],
  data() {
    return {
      active: 2,
      order_goods: {}
    }
  },
  created() {
    this.getOrderGoodInfo()
  },
  methods: {
    async getOrderGoodInfo() {
      let res = await this.$axios.get('/orders/getOrderGoodByGoodIdAndOrderNo', {
        params: {
          'good_id': this.good_id,
          'orderNo': this.orderNo,
        }
      })
      this.order_goods = res.data
    }
  }
}
</script>

<style scoped>
.serviceHeader {
  background: #f5f5f5;
}

.breadcrumbs, .breadcrumbs a {
  color: #757575;
}

.breadcrumbs {
  height: 40px;
  font-size: 12px;
  line-height: 40px;
  background: #f5f5f5;
}

.container {
  width: 1226px;
  margin-right: auto;
  margin-left: auto;
}

.content {
  width: 100%;
}

.service-main-box {
  padding: 36px 0;
}

.service-box {
  background: #fff;
}

.service-content-box {
  margin: 0 120px;
}

.title {
  margin: 0;
  font-size: 36px;
  font-weight: 400;
  line-height: 68px;
  color: #b0b0b0;
}

.service-content-box .service-section .section-hd {
  height: 50px;
  padding: 0 32px;
  margin-bottom: 28px;
  border-left: 2px solid #ff6700;
  background-color: #eee;
  color: #333;
}

.service-content-box .service-section .section-title {
  margin: 0;
  font-size: 16px;
  font-weight: 400;
  line-height: 50px;
}

.service-content-box .service-section .section-bd {
  margin-bottom: 28px;
}

.service-content-box .product-detail {
  position: relative;
  height: 70px;
  padding: 35px 124px 35px 135px;
  border: 1px solid #e0e0e0;
  border-left: 2px solid #b0b0b0;
  font-size: medium;
}

.service-content-box .product-detail .detail-list, .service-content-box .product-detail .detail-list dd {
  margin: 0;
}

.service-content-box .product-detail .back {
  position: absolute;
  right: 40px;
  top: 60px;
  font-size: 12px;
  color: #ff6700;
}

.service-content-box .product-detail .thumb {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 100px;
  height: 100px;
}

.service-content-box .service-section .section-hd {
  height: 50px;
  padding: 0 32px;
  margin-bottom: 28px;
  border-left: 2px solid #ff6700;
  background-color: #eee;
  color: #333;
}

.service-content-box .service-section .section-title {
  margin: 0;
  font-size: 16px;
  font-weight: 400;
  line-height: 50px;
}

.service-content-box .service-label-list {
  width: 902px;
  margin: 0;
  padding: 0;
  list-style-type: none;
  overflow: hidden;
  _zoom: 1;
}

ul {
  display: block;
  list-style-type: disc;
  margin-block-start: 1em;
  margin-block-end: 1em;
  margin-inline-start: 0px;
  margin-inline-end: 0px;
  padding-inline-start: 40px;
}

.service-content-box .service-label-list-large li {
  width: 284px;
  height: 76px;
  margin-right: 15px;
}

.service-content-box .service-label-list .active {
  border-color: #83c44e;
  color: #83c44e;
  cursor: default;
}

.service-content-box .service-label-list li {
  float: left;
  _display: inline;
  width: 160px;
  height: 40px;
  margin: 0 20px 20px 0;
}

/*router-link*/
.service-content-box .service-label-list-large a {
  width: 282px;
  height: 74px;
  font-size: 18px;
  line-height: 74px;
}

.service-content-box .service-section .tip {
  margin: -10px 0 30px 20px;
  color: #757575;
}

/*router-link*/
.service-content-box .service-label-list a {
  display: block;
  width: 158px;
  height: 38px;
  border: 1px solid #b0b0b0;
  font-size: 14px;
  line-height: 38px;
  text-align: center;
  color: #757575;
  cursor: pointer;
}
</style>
